package cn.sunshine.ymcc.service.impl;

import cn.sunshine.ymcc.domain.MessagePullback;
import cn.sunshine.ymcc.domain.MessageSms;
import cn.sunshine.ymcc.mapper.MessagePullbackMapper;
import cn.sunshine.ymcc.mapper.MessageSmsMapper;
import cn.sunshine.ymcc.service.IMessagePullbackService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Mr.Jiang
 * @since 2022-08-09
 */
@Service
public class MessagePullbackServiceImpl extends ServiceImpl<MessagePullbackMapper, MessagePullback> implements IMessagePullbackService {
@Autowired
private MessagePullbackMapper messagePullbackMapper;
@Autowired
private MessageSmsMapper messageSmsMapper;
    @Override
    public Boolean pullBack(Long id) {
        MessageSms messageSms = messageSmsMapper.selectById(id);
        MessagePullback messagePullback = new MessagePullback();
        messagePullback.setIp(messageSms.getIp());
        messagePullback.setTitle(messageSms.getTitle());
        messagePullback.setUserId(messageSms.getUserId());
        messagePullbackMapper.insert(messagePullback);
        return true;
    }
}
